apiVersion: apps/v1
kind: Deployment
metadata:
  name: api-server-deployment
  labels:
    app: api-server
spec:
  strategy:
    rollingUpdate:
      maxSurge: 1
      maxUnavailable: 0
    type: RollingUpdate
  selector:
    matchLabels:
      app: api-server
  template:
    metadata:
      labels:
        app: api-server
    spec:
      containers:
        - name: api-server
          image: dmitrykaplan/api:1
          envFrom:
            - secretRef:
                name: api-server-secret
            - secretRef:
                name: jwt-secret
          ports:
            - containerPort: 8080

---
apiVersion: v1
kind: Service
metadata:
  name: api-server-service
  labels:
    app: api-server

spec:
  selector:
    app: api-server
  ports:
    - port: 3000
      targetPort: 8080
      nodePort: 30000
  type: NodePort

